class CreateUsers < ActiveRecord::Migration
  def self.up
    create_table "users", :force => true do |t|
      t.column :login,                     :string
      t.column :email,                     :string
      t.column :crypted_password,          :string, :limit => 40
      t.column :salt,                      :string, :limit => 40
      t.column :created_at,                :datetime
      t.column :updated_at,                :datetime
      t.column :remember_token,            :string
      t.column :remember_token_expires_at, :datetime
      t.belongs_to :tipouser
    end

    user = User.new
    user.login = 'admin'
    user.email = 'admin@alpargatas.com.br'
    user.crypted_password = 'c8a12447151ad89cf39aedd60e281e8d8f7fc9b9'
    user.salt = '2bc0fe346e5c49eb3812df005bff56d7760e5558'
    user.tipouser_id = 1
    user.save
  end

  def self.down
    drop_table "users"
  end
end
